import java.util.Scanner;

public class Difference {
    static int N=100010;
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int []a=new int[N];
        int []b=new int[N];
        for(int i=1;i<=n;i++){
            a[i]=sc.nextInt();
        }
        for(int i=1;i<=n;i++){
            insert(i,i,a[i],b);
        }
        while (m-->0){
            int l=sc.nextInt();
            int r=sc.nextInt();
            int c=sc.nextInt();
            insert(l,r,c,b);
        }
        for(int i=1;i<=n;i++){
            b[i]+=b[i-1];
            System.out.print(b[i]+" ");
        }
        System.out.println();
        sc.close();

    }
    public static void insert(int l,int r,int c,int []a){
        a[l]+=c;
        a[r+1]-=c;
    }
}
